#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
	int n, yh[20 + 5][20 + 5], i, j;
	while (cin >> n)
	{
		if (!n)break;
		//init
		for (i = 0; i <= n; i++)for (j = 0; j <= n; j++)yh[i][j] = 0;
		yh[0][1] = 1;
		//insert
		for (i = 1; i < n; i++)for (j = 1; j < i + 2; j++)yh[i][j] = yh[i - 1][j] + yh[i - 1][j - 1];
		//output
		for (i = 0; i < n; i++)
		{
			for (j = 1; j < i + 2; j++) { if (j != 1)cout << " "; cout << yh[i][j]; }
			cout << endl;
		}
	}
	return 0;
}